package com.atguigu.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * The type Test.
 */
class  Test{
    public static void main(String[] args) throws ClassNotFoundException, SQLException {

        Class.forName("com.mysql.jdbc.Driver");

        String url = "jdbc:mysql://localhost:3306/day04_test01_bookstore";
        Connection conn = DriverManager.getConnection(url, "root", "123456");

        conn.setAutoCommit(false);

        String sql1 ="delete from day04_test01_bookstore.orders where day04_test01_bookstore.orders.id=?";
        PreparedStatement pst1 = conn.prepareStatement(sql1);
        String sql2 ="delete from order_items where order_id=?";
        PreparedStatement pst2 = conn.prepareStatement(sql2);

        pst1.setString(1,"12313321");
        pst2.setString(1,"12313321");



    }
}
